# -*- coding: utf-8 -*-
from application import app


class UrlManager(object):
    def __init__(self):
        pass

    @staticmethod
    def buildUrl(path):
        return path

    @staticmethod
    def buildStaticUrl(path):
        ver = "%s" % (22222222)
        path = "/static" + path + "?ver=" + ver
        return UrlManager.buildUrl(path)

    @staticmethod
    def buildImageUrl(path):  # 图片的地址，在美食列表中set上传图片展示中使用到
        app_config = app.config['APP']  # 'domain': 'http://192.168.3.178:8999'
        # url=http://127.0.0.1:8999/static/upload/20250816/e85a30f1888f40a3a19128ea89d39c94.jpg
        url = app_config['domain'] + app.config['UPLOAD']['prefix_url'] + path
        return url
